//
//  GoodsModel.h
//  lokebao
//
//  Created by 陈书钦 on 15/6/27.
//  Copyright (c) 2015年 sky. All rights reserved.
//

#import <Foundation/Foundation.h>

@protocol XYModelDelegate;

@interface XYModel : NSObject

@property (nonatomic, weak) id<XYModelDelegate> delegate;

+ (instancetype)model;
+ (instancetype)modelWithDictionary:(NSDictionary *)dictionary;

- (void)setupWithDictionary:(NSDictionary *)dictionary;
/** 控件更新数据后，通知模型收集数据 */
- (void)modelShouldUpdate;
/** 模型更新数据后，通知控件收集数据 */
- (void)modelDidUpdate;

- (NSDictionary *)dictionary;

@end

@protocol XYModelDelegate <NSObject>

@optional
// 控件更新数据后，通知模型收集数据
- (void)modelShouldUpdate:(XYModel *)model;
// 模型更新数据后，通知控件收集数据
- (void)modelDidUpdate:(XYModel *)model;

@end
